﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>Visifire Test Page</title>
        <script type="text/javascript" src="../Visifire.js"></script>
    <style type="text/css">
        #button1
        {
            width: 157px;
        }
    </style>
</head>
    
<body style="background-color:Gray;">
    
    <div id="VisifireChart0">
        <script type="text/javascript">

            // Create Visifire object
            var vChart = new Visifire('../ClientBin/SL.Visifire.Charts.xap', "MyChart", 500, 300);
            vChart.setDataUri("data1.xml");

            vChart.loaded = function(args) {
                var chart = args[0];   // Chart reference.
            }

            vChart.render("VisifireChart0");

            function SetNewChart() {

                vChart.setDataUri("data1.xml?reqtime=" + (new Date()).getTime());
                vChart.render("VisifireChart0");
            };
            
            function ButtonClick() {
                SetNewChart();
                setTimeout(ButtonClick, 1000);
            };
            
        </script>
    </div>
    <button id="button1" type="button" onclick="ButtonClick()">
        Click here to render</button>
</body>

</html>
